package christ.mmd.bl;

import java.util.ArrayList;

import android.os.Parcel;
import android.os.Parcelable;

public class Community extends DataItem implements Parcelable {

	String mName;
	String mWebSiteUrls;
	String mEmail;
	String mPhone;
	String mAddress;
	String mDescription;
	ArrayList<Image> mImages;

	public Community(long id, String name, String urlCSV, String email,
			String phone, String address, String description) {
		this(id, name, urlCSV, email, phone, address, description,
				new ArrayList<Image>());
	}

	public Community(long id, String name, String urlCSV, String email,
			String phone, String address, String description,
			ArrayList<Image> images) {
		super(id);
		mName = name;
		mWebSiteUrls = urlCSV;
		mEmail = email;
		mPhone = phone;
		mAddress = address;
		mDescription = description;
		mImages = images;
	}

	public Community(Parcel in) {
		this(in.readLong(), in.readString(), in.readString(), in.readString(),
				in.readString(), in.readString(), in.readString());
		in.readList(mImages, getClass().getClassLoader());
	}

	@Override
	public String toString() {
		return mName;
	}

	public int describeContents() {
		return 0;
	}

	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(mId);
		dest.writeString(mName);
		dest.writeString(mWebSiteUrls);
		dest.writeString(mEmail);
		dest.writeString(mPhone);
		dest.writeString(mAddress);
		dest.writeString(mDescription);
		dest.writeList(mImages);
	}

	public static final Parcelable.Creator<Community> CREATOR = new Parcelable.Creator<Community>() {
		public Community createFromParcel(Parcel in) {
			return new Community(in);
		}

		public Community[] newArray(int size) {
			return new Community[size];
		}
	};
}
